<?php
namespace Home\Controller;

use Util\AccessController;

class BannerController extends AccessController {
    public function GetBanner() {
        $files = 'banner_img as img ,banner_url as url , banner_number as sort';
        $where['banner_url_type'] = 4;
        $order = 'banner_number DESC';
        $LS = Service('Banner', 'banner');
        $LBdata = $LS->query($where, null, $files, $order);
        $DATA = ResData($LBdata);
        $this->ajaxReturn($DATA, 'JSON');
    }

    public function GetBookList() {
        $files = 'banner_img as img ,banner_url as url , banner_number as sort ,banner_title as title,banner_id as id,banner_f_title';
        $order = 'banner_number Desc';
        $where['banner_url_type'] = 1;
        $where['banner_number'] = array('egt',
            0);
        $LS = Service('Banner', 'banner');
        $LBdata = $LS->query($where, null, $files, $order);
        $DATA = ResData($LBdata);
        $this->ajaxReturn($DATA, 'JSON');
    }
/*
 * 获取尺寸
 */
    public function GetSize(){
        $data[] =array(690,270);
        $data[] =array(680,230);
        $DATA = ResData($data);
        $this->ajaxReturn($DATA, 'JSON');
    }

}